package com.yunxi.service.dubboService.impl.sto;

import com.github.pagehelper.PageInfo;
import com.yunxi.model.sto.ApproveHis;
import com.yunxi.service.localService.sto.ApproveHisService;
import com.yunxi.sto.pojo.ApproveHisVO;
import com.yunxi.sto.service.ApproveHisDubboService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import java.util.List;

/**
 * <p>
 * 审核历史 服务实现类
 * </p>
 *
 * @author caoYong
 * @since 2019-09-03
 */
public class ApproveHisDubboServiceImpl implements ApproveHisDubboService {

    @Autowired
    @Qualifier(value = "approveHisServiceImpl")
    ApproveHisService approveHisService;


    @Override
    public ApproveHisVO getById(String id) throws Exception {
        ApproveHis approveHis = approveHisService.getById(id);
        ApproveHisVO approveHisVO = new ApproveHisVO();
        BeanUtils.copyProperties(approveHis, approveHisVO);
        return approveHisVO;
    }

    @Override
    public void saveOrUpdate(ApproveHisVO approveHisVO) throws Exception {
        ApproveHis approveHis = new ApproveHis();
        BeanUtils.copyProperties(approveHisVO, approveHis);
        approveHisService.saveOrUpdate(approveHis);
    }

    @Override
    public void removeById(String id) {
        approveHisService.removeById(id);
    }

    @Override
    public PageInfo<ApproveHisVO> findPageByVO(ApproveHisVO approveHisVO, Integer pageNum, Integer pageSize) throws Exception {
        PageInfo<ApproveHisVO> pageInfo = approveHisService.pageByVo(approveHisVO, pageNum, pageSize);
        return pageInfo;
    }

    @Override
    public void removeByListVo(List<ApproveHisVO> approveHisVOList) throws Exception {
        approveHisService.removeByListVo(approveHisVOList);
    }

    @Override
    public List listByVo(ApproveHisVO approveHisVO) {
        return approveHisService.listByVo(approveHisVO);
    }
}
